package api.list.practice01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class StringDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("发誓非期望");
        list.add("大萨达撒");
        list.add("开发和国土局");
        list.add("二二认为发生过的呀");
        System.out.println(list);


        Collections.sort(list, (o1, o2) -> o1.length() - o2.length());
        System.out.println(list);
    }
}
